Component({
    properties: {},
    data: {
        latitude: 0,
        longitude: 0,
        markers: []
    },
    methods: {
        onLoad() {
            const that = this;
            wx.getLocation({
                type: 'wgs84',
                success: function (res) {
                    that.setData({
                        latitude: res.latitude,
                        longitude: res.longitude,
                        markers: [{
                            id: 0,
                            latitude: res.latitude,
                            longitude: res.longitude,
                            iconPath: '../../assets/images/marker.png',
                            width: 50,
                            height: 50
                        }]
                    });
                }
            })
        }
    }
});
